<template lang="">
    <div>
        <van-field label='名称' v-model='name'/>
        <van-button @click='add'>添加</van-button>

        <br/>
        列表展示 <br/>
        <ul>
            <li v-for='i in wlist'>{{i.name}}
                <router-link :to="{'path':'/wfparams','query':{'id':i.id}}">
                    配制参数</router-link>
            </li>
        </ul>
    </div>
</template>
<script>
export default {
    data(){
        return{
            name:'',
            wlist:[]
        }
    },
    methods: {
        add(){
            this.axios.post('workfM',{'name':this.name}).then(res=>{
                this.getlist()
            })
        },
        getlist(){
            this.axios.get('workfM').then(res=>{
                this.wlist = res.data.list
            })
        }
    },
    mounted() {
        this.getlist()
    },
}
</script>
<style lang="">
    
</style>